﻿<?php session_start(); ?>
<!DOCTYPE html>
<html>
<head>
	<meta charset=utf-8 />
	<title></title>
    
    <?php include('includes/dependencies.php'); ?> 
</head>

<body>
    <div id="container" class="container">

		<!-- HEADER -->    
		<?php 
			$activeLink = "products";
			include('includes/header.php'); 
		?> 
		
		<div id="content">
        	<h1> Az ön kosara az alábbi terméket tartalmazza! </h1>

			<table class="table">
			<tr>
				<th>Termék neve</th>
				<th>Termék ára</th>
				<th>Darab</th>
				<th>Műveletek</th>
			</tr>
			
			<?php 
				require_once('classes/Products.php');
				$products = Products::getInstance();
				
				if($_SESSION['cart'])
				{ 
					foreach($_SESSION['cart'] as $product_id => $quantity) { 
						$prod = $products->getProductById($product_id);
						echo '<tr>';
						echo 	'<td>' . $prod->name . '</td>';
						echo '	<td>' . $prod->price . '</td>';
						echo '	<td>' . $quantity . '</td>';
						echo '	<td><a href="php/handleCart?pid='. $product_id .'&action=removeall">Törlés</a></td>';
						echo '<tr>';
					}
				}
		
			?>
			</table>
        </div>

        <!-- FOOTER -->
        <?php include('includes/footer.php'); ?>
    	
    </div>	
</body>
</html>